package io.geekidea.boot.chargeback.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@ToString(callSuper = true)
@NoArgsConstructor
@TableName("tb_chargeback")
public class ChargeBack implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Integer id;

    @Schema(description = "退单号")
    @TableField("numbers")
    private String numbers;

    @Schema(description = "订单号")
    @TableField("orderId")
    private String orderId;

    @Schema(description = "订单类型")
    @TableField("order_types")
    private String orderTypes;


    @Schema(description = "订单子类型")
    @TableField("order_subtype")
    private String orderSubtype;

    @Schema(description = "订单金额")
    @TableField("order_amount")
    private Double orderAmount;

    @Schema(description = "退款金额")
    @TableField("refundAmount")
    private Double refundAmount;

    @Schema(description = "退款状态")
    @TableField("refund_status")
    private Boolean refundStatus;

    @Schema(description = "战区id")
    @TableField("areaId")
    private Integer areaId;

    @Schema(description = "门店id")
    @TableField("storeId")
    private Integer storeId;

    @Schema(description = "审核状态")
    @TableField("audit_status")
    private Boolean auditStatus;

    @Schema(description = "制单人")
    @TableField("prepared_by")
    private String preparedBy;

    @Schema(description = "审核人")
    @TableField("auditor")
    private String auditor;

    @Schema(description = "制单时间")
    @TableField("createdTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private LocalDateTime createdTime;


    @Schema(description = "审核时间")
    @TableField("updatedTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private LocalDateTime updatedTime;

    @Schema(description = "退款原因")
    @TableField("reasons_for_refund")
    private String reasonsForRefund;


    @Schema(description = "逻辑删除")
    @TableField("deleted")
    private String deleted;

    @Schema(description = "创建人")
    @TableField("updatedBy")
    private String createdBy;

    @Schema(description = "修改人")
    @TableField("updatedBy")
    private String updatedBy;

    @Schema(description = "支付方式")
    @TableField("mode_of_payment")
    private String modeOfPayment;

    @TableField(exist = false)
    private String areaName;

    @TableField(exist = false)
    private String storeName;




    @TableField(exist = false)
    private String creatorUser;





    @Schema(description = "合计成本价")
    @TableField("totalcostprice")
    private Double totalCostPrice;

    @Schema(description = "合计间接成本价")
    @TableField("totalindirectcostprice")
    private Double totalIndirectCostPrice;

    @Schema(description = "合计")
    @TableField("he_ji_you_chang")
    private Double heJiYouChang;

    @Schema(description = "合计毛利")
    @TableField("totalgrossmargin")
    private Double totalGrossMargin;

    @Schema(description = "")
    @TableField("collect_flag")
    private String collectFlag;

    @Schema(description = "")
    @TableField("mis_order_no")
    private String misOrderNo;

    @Schema(description = "实收订单金额")
    @TableField("amount")
    private Double amount;

    @Schema(description = "应退金额")
    @TableField("refundableAmount")
    private Double refundableAmount;

    @Schema(description = "提成")
    @TableField("royalty")
    private Double royalty;

    @Schema(description = "应收金额")
    @TableField("amountreceivable")
    private Double amountReceivable;

    @Schema(description = "优惠金额")
    @TableField("coupon")
    private Double coupon;

    @Schema(description = "收款金额")
    @TableField("receivableamount")
    private Double receivableAmount;

    @Schema(description = "退款")
    @TableField("refund")
    private String refund;
}
